package com.ruoyi.business.controller.app;


import com.ruoyi.business.service.IWsdLeaveTypesService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.WsdLeaveTypes;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 请假类型表 小程序
 * </p>
 *
 * @author wwq
 * @since 2024-05-08
 */
@RestController
@RequestMapping("/wx_leave_types")
public class WxAppWsdLeaveTypesController extends BaseController {

    @Autowired
    private IWsdLeaveTypesService wsdLeaveTypesService;

    /**
     * 查询请假类型列表
     */
    @GetMapping("/list")
    public TableDataInfo list(WsdLeaveTypes wsdLeaveTypes) {
        startPage();
        List<WsdLeaveTypes> list = wsdLeaveTypesService.selectWsdLeaveTypesList(wsdLeaveTypes);
        return getDataTable(list);
    }

    /**
     * 获取请假类型详细信息
     */
    @GetMapping(value = "/{leaveTypeId}")
    public AjaxResult getInfo(@PathVariable("leaveTypeId") Long leaveTypeId) {
        return success(wsdLeaveTypesService.selectWsdLeaveTypesByLeaveTypeId(leaveTypeId));
    }

}
